/////////////////////////////////////////////////////////////////////////////
// Original code from libhdfs3. Copyright (c) 2013 - 2014, Pivotal Inc.
// All rights reserved. Author: Zhanwei Wang
/////////////////////////////////////////////////////////////////////////////
//  Modifications by Kumo Inc.
// Copyright (C) Kumo inc. and its affiliates.
// Author: Jeff.li lijippy@163.com
// All rights reserved.
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as published
// by the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program.  If not, see <https://www.gnu.org/licenses/>.
//



#pragma once

#include <kmock/kmock.h>

#include <tests/mock/mock_system.h>

namespace Hdfs {
namespace Mock {

class MockSockSysCall: public MockSockSysCallInterface {
public:
    MOCK_METHOD4(recv , ssize_t (int sock, void * buffer, size_t size, int flag));
    MOCK_METHOD4(send , ssize_t (int sock, const void * buffer, size_t size,
                    int flag));
    MOCK_METHOD3(recvmsg , ssize_t (int socket, struct msghdr *message, int flags));
    MOCK_METHOD4(getaddrinfo , int (const char * __restrict host,
                    const char * __restrict port,
                    const struct addrinfo * __restrict hint,
                    struct addrinfo ** __restrict addr));
    MOCK_METHOD1(freeaddrinfo , void (struct addrinfo * addr));
    MOCK_METHOD3(socket , int (int family, int type, int protocol));
    MOCK_METHOD3(connect , int (int sock, const struct sockaddr * addr,
                    socklen_t len));
    MOCK_METHOD3(getpeername , int (int sock, struct sockaddr * __restrict peer,
                    socklen_t * __restrict len));
    MOCK_METHOD3(fcntl , int (int sock, int flag, int value));
    MOCK_METHOD5(setsockopt , int (int sock, int level, int optname, const void *optval,
                    socklen_t optlen));
    MOCK_METHOD3(poll , int (struct pollfd * pfd, nfds_t size, int timeout));
    MOCK_METHOD2(shutdown , int (int sock, int how));
    MOCK_METHOD1(close , int (int sock));
};

}
}
